#pragma once

#include "MutualWorkerController.h"


class CMutualWorker :
	public CObject
{
	DECLARE_DYNAMIC(CMutualWorker)

private:
	friend UINT __cdecl MutualWorkerProc(LPVOID);

	CEvent &m_revOwn;
	CEvent &m_revOther;

protected:
	CMutualWorkerController &m_rController;

	CMutualWorker(CMutualWorkerController &a_Controller, CEvent &a_revOwn, CEvent &a_revOther);

	VOID Switch();

	virtual VOID Run() = 0;

public:
	CWinThread *Start();

};
